//
//  JsonRequest.m
//  NewsReader
//
//  Created by blacksun on 11-2-16.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "JsonRequest.h"


@implementation JsonRequest

- (void)connectionDidFinishLoading:(NSURLConnection *)connection{
    NSString *str = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
	NSLog(@"%@",str);
	NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
	
	NSDictionary *json = [str JSONValue];
	[self.delegate request:self successWithResult:json andCommand:self.command];
	[pool release];
	
	[str release];
	self.responseData = nil;
	self.currentConnection = nil;
}

@end
